Add project-specific tests, fix related bugs