rm bar and fix compiler warnings