bugfixes and added unit tests for all implemented circuits