ongoing unit testing and bug fixes