Calculator bug fixes