Fixed problem with number calculations