Add install.php, several bug fixes