fix few remaining bugs