Some more changes to the QM/MM kernel; can now handle p-s terms