Various fixes and expansion. <Sam>