Review

A bunch of code fixes