Merge in personal fix_issue_157 branch contents

These are the same contents I committed in March, some time ago. I need to start building a personal flixel branch for our own needs; tracking relevant changes to the master repo should be relatively simple.