Adding type to scopes (for debugging) and better tests