More conditional code for UT cases
Verified more bug fixes and adjusted the UTs
Finished verifying bug fixes for now
PEP8 passed