Fixed a couple of bugs and added CORC support