Fix ALL the issues, add more tests