Fix for 3053,3055 and some cleanup