fix compiling with fpc < 2.6.4
further work on calculator