Fixed old tests and added new ones.