Fix a few buggies and potential security issues