Some fixes to erlang check