Important bug improvements/fixes