fix index and other tweaks