Fixed: min and max functions (fixes #130)