Fixed some bugs causing installation problems