Tested and fixed some minor issues