Some bug fixes. Still some to work out.