src: multiple bugs fixed,