Minor code improvements and updated README