Fixed details page and cleaned up code.