Brett - bug fixes