Fixed checkout and checkin subroutines