Bug fixes, cleanup, linking...