Prevent potential divisions by 0 when using them immediately after allocation. Signed-off-by: James Almer <jamrial@gmail.com>