Fixed flex drag bugs, various source cleanup