Removed log lines and fixed a bug.