Fixing and adding more tests