Fixed a few reference errors and the 500 being thrown when clicking on a
delete button.