Core pr 5

Minor bug fixes.