Fixes the issue of file marshalling

This is a simpler solution to #441 :)