Drop some wrong weak_ref
Add java style error detection