Added testing instructions. Fixed several bugs so that all tests finally pass