Moved uncheck pixel setting to a static function. Added boundary checking to initialization and space-setting functions.
Added boundary checking to line and rectangle functions.