More generic fixes/bug preventions