Changed error handling, added debug code
Modified toString to handle null start and/or end