Made updating of fields more robust by handling char values that are None and invalid enum values
Explicitly defined argument and return types for all used C functions
Removed unused print_function future import