Changed output format slightly
Small bug fixes.