Clean up the set command

Various messy places of the set command cleaned up / made more consistent.