Fixed Python errors and plots