Added tests and fixed error in slot check_availability logic