Changed file param to be alteredfile in pre-commit to prevent conflict with built-in file
Added getfields method, use it instead of accessing _fields directly
Removed whitespace from empty line