merged in some bug fixes from a forum post on http://sketchucation.com