Working on some bug corrections