Fixes IndexError and incorrect path on get_model_path. thanks to @bufke