Fixing some problems. fix #2 #3