Fix #516
Try this #514.
Fix #527
Fix #526.