Fixed post-to-resource (quick hack), and removed some obsolete code.