Fix for having a max value smaller then min

Fix for issue #18.