Small errors and warnings fixes