Add spec and some cs fixes.