Fixed add_folder and added some convenience functions for error checking