Various fixes for improving flexibility