Fixed serialization & other minor bugs.