Fixed crash in calc