Fix compiler errors, tests failing however