maj (fix exception)
Fix some  bugs