Bug fixes for James