Added bugfixes for #3438 #3430 #3388

Added bugfixes for #3438 #3430 #3388