Fixed more warnings and resolved problem from previous merge.