Rev 28

Some bug fixes by Rob