fix deserialization of None values

Also remove unused variable