Unit testing support and bug fixing