fix issue #10: set min or max to val if they are still null