Fixed crashes and supported more models.

Signed-off-by: interdpth <interdpth@gmail.com>