Fixed various client bugs.