Removed use of fmax since double/unsignedness badness, replaced with own umax function. Fixed one bug using minWidth instead of minHeight