Fixed various errors and create shell script for reproducing steps