Some Minor Bugs Fixes