Various fixes & improvements