Some bits fixed, should be all correct now