Clean up helper functions
Add PUT file handle test