Fixed up action stuff and removed some debug code