fixing a few minor bugs which should remove errors and redirects therefore speeding things up a little