calculator bug fixes