Use Single() instead of First() where appropriate (plus a little more cleanup)