Fast patch to fix bugs

Fast patch, not the absolute best of code but the built in tool convars
aren't pretty to work with in this case and there are large changes
coming.