Added first regression tests, among others

See the comments for what has been changed.