As CCFisher said, disconnect the shift linkage at the trans and verify each position. Set the trans into park and the shifter into park and redo the connection. Have a helper shift each gear while you verify the linkage moves correctly.

Are you certain it worked correctly before the screws came loose?